package com.supreme.omsserver.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

@Configuration
public class BaseConfig {

    @Value("${spring.application.name}")
    private String applicationName;

    @Value("${spring.profiles.active}")
    private String profilesActive;

    @Resource
    private ServerCustomConfig serverCustomConfig;

    @PostConstruct
    private void showServerBaseInfo() {
        System.out.printf("applicationName = %s profilesActive = %s\n", applicationName, profilesActive);
        System.out.printf("userDir = %s projectDir = %s\n", serverCustomConfig.getUserDir(), serverCustomConfig.getProjectDir());

        System.out.println("serverCustomConfig.getArgName() = " + serverCustomConfig.getArgName());
        System.out.println("serverCustomConfig.getEnvName() = " + serverCustomConfig.getEnvName());
        System.out.println("serverCustomConfig.getDockerArgLabel() = " + serverCustomConfig.getDockerArgLabel());
        System.out.println("serverCustomConfig.getDockerArgValue() = " + serverCustomConfig.getDockerArgValue());
        System.out.println("serverCustomConfig.getDockerEnvLabel() = " + serverCustomConfig.getDockerEnvLabel());
        System.out.println("serverCustomConfig.getDockerEnvValue() = " + serverCustomConfig.getDockerEnvValue());
    }
}
